<?php

include("modules/search/global.php");

if($userloggedinarray[15]!=="administrator"){
	unset($tplcontent);
	$tplcontent['notice'].="Must be logged in as administrator to use control panel!";
	echo template('notice',$tplcontent);
}else{
	
	if(!$editconfig){
		unset($tplcontent);
		
		$tplcontent['formheader'].="<form action=\"admin_modules.php\" method=post>";
		$tplcontent['formheader'].="<input type=hidden name=\"module\" value=\"search\">";
		$tplcontent['formheader'].="<input type=hidden name=\"editconfig\" value=\"1\">";
		
		$tplcontent['resultsperpage'].="<input type=text name=\"resultsperpage\" value=\"$searchmoduleconfig[0]\" size=40 class=\"forminput\"><br>";
		
		$tplcontent['submitbutton'].="<input type=submit name=\"submit\" value=\"Update\" class=\"formbutton\">";
		
		$tplcontent['formfooter'].="</form>";
		
		echo template('modules/search/searchadmin',$tplcontent);
	}
	
	if($editconfig){
		
		writedata("$configarray[20]/search/config.php",$resultsperpage,0);
		
		unset($tplcontent);
		$tplcontent['notice'].="Search module config updated!";
		echo template('notice',$tplcontent);
	}
	
}

?>
